home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Online / hsc / source / hscprj / document.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-02  |  3.5 KB  |  114 lines

  1. /*
  2.  * This source code is part of hsc, a html-preprocessor,
  3.  * Copyright (C) 1995-1997  Thomas Aglassinger
  4.  *
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or
  8.  * (at your option) any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  */
  20. /*
  21.  * hsclib/document.h
  22.  *
  23.  * document managment routines for hsc
  24.  *
  25.  */
  26.  
  27. #ifndef HSCPRJ_DOCUMENT_H
  28. #define HSCPRJ_DOCUMENT_H
  29.  
  30. #include "hsclib/ldebug.h"
  31.  
  32. #include "ugly/utypes.h"
  33. #include "ugly/dllist.h"
  34. #include "ugly/expstr.h"
  35. #include "ugly/umemory.h"
  36. #include "ugly/ustring.h"
  37. #include "ugly/infile.h"
  38.  
  39. /* document structure */
  40. typedef struct document_node {
  41.     STRPTR docname;             /* document name */
  42.     STRPTR sourcename;          /* main sourcefile name */
  43.     EXPSTR *title;              /* title specified with <TITLE> */
  44.     DLLIST *iddefs;             /* list of IDs defined in this file */
  45.     DLLIST *includes;           /* list of included files */
  46.     DLLIST *references;         /* list of docs/images/.. references
  47.                                  *   within this document */
  48.     ULONG  flags;               /* document flags */
  49. } HSCDOC;
  50.  
  51. /* document flags */
  52. #define DF_INFO_IDDEF     (1<<0)
  53. #define DF_CALL_IDDEF     (1<<1)
  54. #define DF_INFO_REFERENCE (1<<2)
  55. #define DF_CALL_REFERENCE (1<<3)
  56. #define DF_INFO_INCLUDE   (1<<4)
  57. #define DF_CALL_INCLUDE   (1<<5)
  58.  
  59. /* caller structure */
  60. typedef struct caller_node {
  61.     STRPTR name;
  62.     ULONG posx;
  63.     ULONG posy;
  64. } CALLER;
  65.  
  66. /* reference structure */
  67. typedef struct reference_node {
  68.     STRPTR name;
  69.     CALLER *caller;
  70. } HSCREF;
  71.  
  72. /* include structure */
  73. typedef struct include_node {
  74.     STRPTR name;
  75.     CALLER *caller;
  76. } HSCINC;
  77.  
  78. /* id-definition structure */
  79. typedef struct iddef_node {
  80.     STRPTR name;
  81.     CALLER *caller;
  82.     INFILEPOS *fpos; /* only used by local IDs for error-position */
  83. } HSCIDD;
  84.  
  85. extern CALLER *new_caller(STRPTR fname, ULONG posx, ULONG posy);
  86. extern VOID del_caller(APTR data);
  87. extern CALLER *fpos2caller(INFILEPOS * fpos);
  88.  
  89. extern HSCDOC *new_document(STRPTR docname);
  90. extern VOID del_document(APTR data);
  91. extern int cmp_document(APTR cmp_data, APTR list_data);
  92. extern DLNODE *find_document_node(DLLIST *list, STRPTR name);
  93. extern HSCDOC *find_document(DLLIST * list, STRPTR name);
  94.  
  95. extern VOID del_reference(APTR data);
  96. extern HSCREF *new_reference(STRPTR newname);
  97. extern int cmp_reference(APTR cmp_data, APTR list_data);
  98. extern HSCREF *app_reference(HSCDOC * document, STRPTR ref_name);
  99.  
  100. extern VOID del_include(APTR data);
  101. extern HSCINC *new_include(STRPTR newname);
  102. extern int cmp_include(APTR cmp_data, APTR list_data);
  103. extern HSCINC *app_include(HSCDOC * document, STRPTR inc_name);
  104.  
  105. extern VOID del_iddef(APTR data);
  106. extern HSCIDD *new_iddef(STRPTR newname);
  107. extern VOID prt_iddef(FILE * stream, APTR data);
  108. extern int cmp_iddef(APTR cmp_data, APTR list_data);
  109. extern HSCIDD *app_iddef(HSCDOC * document, STRPTR iddef_name);
  110. extern HSCIDD *find_iddef(HSCDOC * document, STRPTR name);
  111.  
  112. #endif /* HSCPRJ_DOCUMENT_H */
  113.  
  114.